package org.crystal.tradecraft.model.binance.market.filter;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.crystal.tradecraft.model.binance.enumeration.FilterType;

/**
 * <h3>PERCENT_PRICE_BY_SIDE</h3>
 * PERCENT_PRICE_BY_SIDE 过滤器定义了基于交易对平均价格的合法价格范围. 取决于BUY或者SELL; 价格范围可能有所不同.<p>
 * <p>
 * avgPriceMins 是用来计算平均价格的分钟数. 0 表示用最新价(last price).<p>
 * <p>
 * 买向订单需要满足:<p>
 * <ul>
 *     <li>Order price <= weightedAveragePrice * bidMultiplierUp</li>
 *     <li>Order price >= weightedAveragePrice * bidMultiplierDown</li>
 * </ul>
 * 卖向订单需要满足:<p>
 * <ul>
 *     <li>Order Price <= weightedAveragePrice * askMultiplierUp</li>
 *     <li>Order Price >= weightedAveragePrice * askMultiplierDown</li>
 * </ul>
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class PercentPriceBySide extends BinanceFilter {

    public PercentPriceBySide() {
        super(FilterType.PERCENT_PRICE_BY_SIDE);
    }

    private double bidMultiplierUp;

    private double bidMultiplierDown;

    private double askMultiplierUp;

    private double askMultiplierDown;

    private int avgPriceMins;
}
